<template>
<div>
  <h1>图书添加页面</h1>
  图书名称:<input type="text" v-model="form.bname"><br>
  图书价格:<input type="text" v-model="form.modney"><br>
  图书作者: <select name="" id="" v-model="form.waijian">
  <option :value="i.id" v-for="i in list">{{i.name}}</option>
</select><br>
  <button @click="add">提交</button>
</div>
</template>
<script>
export default {
  name: "ce_3",
  data(){
    return{
      form:{},
      list:[]
    }
  },
  methods:{
    add(){
      this.axios.post('user/Bbook/',this.form)
        .then(res=>{
          alert(res.data)
          this.$router.push('ce_2')
        })
    },
    zuo(){
      this.axios.get('user/Buser')
      .then(res=>{
        this.list=res.data.list
      })
    }
  },
  mounted() {
    this.zuo()
  }
}
</script>

<style scoped>

</style>
